package com.lsz.deport.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.lsz.deport.db.bean.CommodityBean;
import com.lsz.deport.db.bean.PackageBean;

import com.lsz.deport.db.CommodityBeanDao;
import com.lsz.deport.db.PackageBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig commodityBeanDaoConfig;
    private final DaoConfig packageBeanDaoConfig;

    private final CommodityBeanDao commodityBeanDao;
    private final PackageBeanDao packageBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        commodityBeanDaoConfig = daoConfigMap.get(CommodityBeanDao.class).clone();
        commodityBeanDaoConfig.initIdentityScope(type);

        packageBeanDaoConfig = daoConfigMap.get(PackageBeanDao.class).clone();
        packageBeanDaoConfig.initIdentityScope(type);

        commodityBeanDao = new CommodityBeanDao(commodityBeanDaoConfig, this);
        packageBeanDao = new PackageBeanDao(packageBeanDaoConfig, this);

        registerDao(CommodityBean.class, commodityBeanDao);
        registerDao(PackageBean.class, packageBeanDao);
    }
    
    public void clear() {
        commodityBeanDaoConfig.clearIdentityScope();
        packageBeanDaoConfig.clearIdentityScope();
    }

    public CommodityBeanDao getCommodityBeanDao() {
        return commodityBeanDao;
    }

    public PackageBeanDao getPackageBeanDao() {
        return packageBeanDao;
    }

}
